package com.wjh.listener;

import javafx.application.Application;
import org.apache.activemq.command.ActiveMQTextMessage;
import org.springframework.beans.BeansException;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.support.BeanDefinitionBuilder;
import org.springframework.beans.factory.support.DefaultListableBeanFactory;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware;
import org.springframework.jms.annotation.JmsListener;
import org.springframework.jms.core.JmsTemplate;
import org.springframework.stereotype.Component;

import javax.jms.Destination;
import javax.jms.JMSException;

//@Component
public class Consumer   {


//    @JmsListener(destination = "jms-Reply",containerFactory = "onlineJmsQueueListener")
//    public void onlineReadMsg(ActiveMQTextMessage activeMQTextMessage) throws JMSException {
//        System.out.println("接收到线上消息：" + activeMQTextMessage.getText());
//    }


    @JmsListener(destination = "${test}",containerFactory = "offlineJmsQueueListener")
    public void offlineReadMsg(ActiveMQTextMessage activeMQTextMessage) throws JMSException {
        System.out.println("接收到线下消息：" + activeMQTextMessage.getText());
    }
}